﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <!--[if lt IE 9]>
    <script type="text/javascript" src="lib/html5.js"></script>
    <script type="text/javascript" src="lib/respond.min.js"></script>
    <script type="text/javascript" src="lib/PIE_IE678.js"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="static/h-ui/css/H-ui.min.css" />
    <link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/H-ui.admin.css" />
    <link rel="stylesheet" type="text/css" href="lib/Hui-iconfont/1.0.7/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="lib/icheck/icheck.css" />
    <link rel="stylesheet" type="text/css" href="static/h-ui.admin/skin/default/skin.css" id="skin" />
    <link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/style.css" />
    <!--[if IE 6]>
    <script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <!-- 权限验证 -->
    <script type="text/javascript" src="static/WebApi.js"></script>
    <title>添加角色</title>
</head>
<body>
    <div class="page-container">
        <form class="form form-horizontal" id="form-role-add">
            <div class="row cl">
                <label class="form-label col-xs-3 col-sm-1"><span class="c-red">*</span>角色名称：</label>
                <div class="formControls col-xs-9 col-sm-10">
                    <input type="text" class="input-text" value="" placeholder="请输入角色名称" id="T_Rname" name="T_Rname" maxlength="10" required="required">
                </div>
            </div>

            <div class="row cl">
                <label class="form-label col-xs-3 col-sm-1">备注：</label>
                <div class="formControls col-xs-9 col-sm-10">
                    <textarea id="T_Remark" name="T_Remark" cols="0" rows="0" class="textarea" placeholder="说点什么...100个字符以内" dragonfly="true" onkeyup="textarealength(this,100)"></textarea>
                    <p class="textarea-numberbar"><em class="textarea-length">0</em>/100</p>
                </div>
            </div>
            <div class="row cl">
                <div class="formControls col-xs-offset-4 col-sm-offset-3">
                    <input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
                </div>
            </div>
        </form>
    </div>

    <!--基本js脚本-->
    <script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script>
    <script type="text/javascript" src="lib/layer/2.1/layer.js"></script>
    <script type="text/javascript" src="lib/icheck/jquery.icheck.min.js"></script>
    <script type="text/javascript" src="lib/jquery.validation/1.14.0/jquery.validate.min.js"></script>
    <script type="text/javascript" src="lib/jquery.validation/1.14.0/validate-methods.js"></script>
    <script type="text/javascript" src="lib/jquery.validation/1.14.0/messages_zh.min.js"></script>
    <script type="text/javascript" src="static/h-ui/js/H-ui.js"></script>
    <script type="text/javascript" src="static/h-ui.admin/js/H-ui.admin.js"></script>
    <!--扩展js脚本-->
    <script type="text/javascript" src="static/Common.js"></script>

    <!--请在下方写此页面业务相关的脚本-->
    <script type="text/javascript">
        $(function () {
            $("#form-role-add").validate({
                onkeyup: false,
                focusCleanup: true,
                success: "valid",
                submitHandler: function () {
                    $.ajax({
                        url: ApiUrl + 'api/Role/Insert',
                        type: 'post',
                        data: $("#form-role-add").serialize(),
                        success: function (data) {
                            if (data == true) {
                                parent.layer.msg("添加角色成功！", { icon: 1, time: 1000 });
                                //parent.location.reload();
                                parent.$("iframe[src='rolemanagment.html']").attr("src", "rolemanagment.html");
                                var index = parent.layer.getFrameIndex(window.name);
                                parent.layer.close(index);
                            }
                            else {
                                layer.msg("添加角色失败！", { icon: 2, time: 1000 });
                            }
                        }
                    });

                }
            });
        });
    </script>
    <!--/请在上方写此页面业务相关的脚本-->
</body>
</html>